﻿using DoNetDrive.AspWebSocke.WebSocketClient;
using DoNetDrive.Core;
using DoNetDrive.Core.Connector;
using DoNetDrive.Core.Factory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DoNetDrive.AspWebSocke
{
    public class WebSocketConnectorFactory : INConnectorFactory
    {
        public INConnector CreateConnector(INConnectorDetail cd, IConnecterManage ConnecterManage)
        {
            return new WebSocketClientConnector((WebSocketClientDetail)cd);
        }


        public async Task<INConnector> CreateConnectorAsync(INConnectorDetail cd, IConnecterManage ConnecterManage)
        {
            var server = new WebSocketClientConnector((WebSocketClientDetail)cd);
            await server.ConnectAsync();
            return server;
        }
    }
}
